package com.bite.java_chatroom.service;

import com.bite.java_chatroom.mapper.MessageMapper;
import com.bite.java_chatroom.model.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageService {


    @Autowired
    private MessageMapper messageMapper;

    public String getLastMessage(Integer sessionId){
        return messageMapper.getLastMessageBySessionId(sessionId);
    }

    public List<Message> getMessageListBySessionId(Integer sessionId){
        return messageMapper.getMessageListBySessionId(sessionId);
    }

}



